package com.yaoxuguang.concurrence.ThreadLocal.variable_isolation;

/**
 * @author yaoxuguang
 * @Title: yao-interview
 * @Package com.yaoxuguang.concurrence.ThreadLocal.variable_isolation
 * @Description: 验证线程变量的隔离性
 * @date 2018年12月24日14:43
 */
public class ThreadA extends Thread{
    @Override
    public void run() {
        try {
            for (int i = 0; i < 100; i++) {
                Tools.threadLocal.set("ThreadA"+(i+1));
                System.out.println("ThreadA get value="+Tools.threadLocal.get());
                Thread.sleep(200);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
